home *** CD-ROM | disk | FTP | other *** search
/ Acorn Risc Technologies StrongARM CD-ROM / Acorn Risc Technologies StrongARM CD-ROM.iso / ftp / documents / appnotes / 001_015 / 010c / Text
Encoding:
Text File  |  1993-08-02  |  3.5 KB  |  89 lines

  1. -----------------------------------------------------------------------------
  2. 25th June 1992
  3. -----------------------------------------------------------------------------
  4. Support Group Application Note
  5. Number: 010
  6. Issue: 1
  7. Author:
  8. -----------------------------------------------------------------------------
  9.  
  10. Printing Labels from a View Macro File
  11.  
  12. -----------------------------------------------------------------------------
  13. Applicable Hardware: BBC B
  14.                      BBC B+
  15.                      BBC Master 128
  16.                      BBC Master Compact
  17.  
  18. Related Application Notes:
  19.  
  20.  
  21. -----------------------------------------------------------------------------
  22. Copyright (C) Acorn Computers Limited 1992
  23.  
  24. Every effort has been made to ensure that the information in this leaflet is 
  25. true and correct at the time of printing. However, the products described in
  26. this leaflet are subject to continuous development and improvements and
  27. Acorn Computers Limited reserves the right to change its specifications at
  28. any time. Acorn Computers Limited cannot accept liability for any loss or
  29. damage arising from the use of any information or particulars in this
  30. leaflet. ACORN, ECONET and ARCHIMEDES are trademarks of Acorn Computers
  31. Limited.
  32. -----------------------------------------------------------------------------
  33. Support Group
  34. Acorn Computers Limited
  35. Acorn House
  36. Vision Park
  37. Histon
  38. Cambridge       CB4 4AE
  39. -----------------------------------------------------------------------------
  40.  
  41. The following BASIC listing can be used to print labels from a View file in
  42. macro format.  The program allows the user to select which fields from the
  43. macro shoul be printed, the order in which they are to be printed and the
  44. number of lines between each label.
  45.  
  46. Before running this program critical points that should be noted are:
  47.  
  48. 1  The printer should be set up and connected to the computer following the
  49. instructions in the relevant user guides.
  50.  
  51. 2  The starting position on the printer should be checked and adjusted on a
  52. short run first to avoid wastage of labels.
  53.  
  54. 3  The View file should be carefully checked to ensure that all addresses
  55. have the same number of fields, adding commas where necessary.
  56.  
  57.           10   REM label print utility
  58.           20   REM Acorn Computers Ltd (c) 1989
  59.           30   ON ERROR VDU3 : CLOSE# 0 : REPORT : PRINT "At line " ERL:END
  60.           40   INPUT"Fields in MACRO "fields%
  61.           50   INPUT"Lines to print out "lines%
  62.           60   INPUT"Lines of gap between labels "gap%
  63.           70   DIM out% (lines%)
  64.           80   PRINT "enter the position of the entries in the MACRO" :"PRINT "in the order you
  65.                  want them printed"
  66.           90   FOR z% =1 TO lines%:PRINT "Lines "z%"is entry? ";
  67.          100   INPUT" "out% (z%) :NEXT
  68.          110   DIM a$ (fields%)
  69.          120   INPUT"Enter name of file to be printed"mg$
  70.          130   INPUT "Output of Printer Y/N" q$
  71.          140   IF INSTR ("Yy",q$) :print=TRUE ELSE print=FALSE
  72.          150   a%=OPENIN (mg$)
  73.          160   IF print:VDU2
  74.          170   PROCnext
  75.          180   FOR z% = 1 TO fields%
  76.          190   as (z%) = FNstring
  77.          200   NEXT
  78.          210   FOR z% = 1 TO lines%
  79.          220   PRINT STRING(gap%, CHR$13)
  80.          230   UNTIL EOF#a%
  81.          240   DEF PROCnext
  82.          250   REPEAT d%=BGET#a%:UNTILd%=&80:PTR#a%=PTR#a%+2
  83.          260   ENDPROC
  84.          270   DEF FNstring
  85.          280   LOCAL c%
  86.          290   r$=" ":REPEAT
  87.          300   c%=BGET#a%
  88.          310   IF c%=ASC" , " OR c%=13:UNTIL1: =r$
  89.          320   r$=r$+CHR$ (c%) :UNTIL0